<template>
  <div class="wodefufu">
    <span>我的服务</span>
    <div class="wodefuwu-item">
      <van-grid :column-num="4">
        <van-grid-item
          v-for="item in grids"
          :key="item.id"
          :icon="item.pic"
          :text="item.name"
          :to="item.url"
        />
          <van-grid-item :icon='"https://java.crmeb.net/static/images/customer.png"' text="联系客服" />
      </van-grid>
    </div>
  </div>
</template>
<script>
import axios from "axios"
export default {
  data() {
    return {
      grids: [],
      authoriZation: localStorage.token,
    }
  },
  methods: {
    async getgrids(authoriZation) {
      await axios.get("https://api.java.crmeb.net/api/front/menu/user", {
        headers: {
          "authori-zation": authoriZation
        }
      }).then(res => {

        this.grids = res.data.data.routine_my_menus
        console.log(res.data.data.routine_my_menus);
      })
    }
  },
  created() {
    this.getgrids(this.authoriZation)
  }
}
</script>
<style lang="scss" scoped>
*{
  margin: 0;
  padding: 0;
}
.wodefufu{
  width: 94%;
  height: 100%;
  margin: auto;
  background: white;
  border-radius: 10px;
  span{
    margin-left: 20px;
  }
}
</style>